<div ng-include="'components/navbar/navbar.html'"></div>

<div class="container">
  <div class="row">
    <div class="col-sm-12">
      <h1>登录系统</h1>
      <p>输入你的用户代码（学号）与姓名就可进入</p>
      <p>如果启用密码登录，请设置自己口令</p>
    </div>
    <div class="col-sm-12">
      <form class="form" name="form" ng-submit="login(form)" novalidate>

        <div class="form-group codename">
          <label>用户代码</label>

          <input type="text" name="code" class="form-control" ng-model="user.code" required>
        </div>
        <div class="form-group codename">
          <label>姓名</label>

          <input type="text" name="name" class="form-control" ng-model="user.name" required>
        </div>
        <div class="form-group hide pass">
          <label>该账号需要口令验证，请输入口令：</label>

          <input type="password" id="password" class="form-control" ng-model="user.password">
        </div>

        <div class="form-group has-error">
          <p class="help-block" ng-show="form.code.$error.required && form.name.$error.required && submitted">
             用户代码和姓名不能为空.
          </p>
          <p class="help-block" ng-show="form.code.$error.code && submitted">
             Please enter a valid code.
          </p>

          <p class="help-block">{{ errors.other }}</p>
        </div>

        <div>
          <button class="btn btn-lg btn-primary btn-login" type="submit">
            登录
          </button>
          <a class="btn btn-default btn-lg btn-register hide" href="/signup">
            Register
          </a>
        </div>

        <div class="hide">
          <a class="btn btn-facebook" href="" ng-click="loginOauth('facebook')">
            <i class="fa fa-facebook"></i> Connect with Facebook
          </a>
          <a class="btn btn-google-plus" href="" ng-click="loginOauth('google')">
            <i class="fa fa-google-plus"></i> Connect with Google+
          </a>
          <a class="btn btn-twitter" href="" ng-click="loginOauth('twitter')">
            <i class="fa fa-twitter"></i> Connect with Twitter
          </a>
        </div>
      </form>
    </div>
  </div>
  <hr>
</div>
